<?php
/**
 * @author			Trần Ngọc Thắng
 * @link			https://facebook.com/tranngoc8x
 * @package			Cake.Console.Templates.default.views
 * @since			CakePHP(tm) v 1.2.0.5234
 * @license			http://www.opensource.org/licenses/mit-license.php MIT License
 */
?>
<div class="row-fluid">
	<?php echo $this->Form->create('Product',array("class"=>"span12 widget stacked dark form-horizontal bordered","type"=>"file")); ?>
	<header><h4 class="title">Nhập thông tin</h4></header>
        <section class="body">
            <div class="body-inner">
				<div class="control-group">
					<label class="control-label"><?php echo __("id");?></label>
					<div class="controls">
						<?php
							echo $this->Form->input('id', array(
								"div" => array(
									"title" => "id"
								),
								"label" => false,
								"class" => "span12"
							))
						?>
					</div>
				</div>

				<?php if(is_file('files/uploads/'.@$this->request->data[Inflector::singularize($this->name)]['image'])){?>
					<div class="control-group">
						<label class="control-label"></label>
						<div class="controls">
							<div style='margin-bottom: 5px'>
								<?php echo $this->Html->image('../files/uploads/'.$this->request->data[Inflector::singularize($this->name)]['image']);?>
							</div>
							<?php echo $this->Form->checkbox('remove');?>Xóa ảnh này
						</div>
					</div>
				<?php }?>
				<div class="control-group">
					<label class="control-label"><?php echo __("image");?></label>
					<div class="controls">
						<div class="fileupload fileupload-new" data-provides="fileupload">
							<div class="input-append">
								<div class="uneditable-input span3">
									<i class="icon-file fileupload-exists"></i>
									<span class="fileupload-preview"></span>
								</div>
								<span class="btn btn-file"><span class="fileupload-new">Chọn file</span>
								<span class="fileupload-exists">Đổi</span>
									<?php echo $this->Form->input("image",array("type"=>"file","label"=>false,"div"=>false)); ?>
								</span>
								<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Xóa</a>
							</div>
						</div>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label"><?php echo __("title");?></label>
					<div class="controls">
						<?php
							echo $this->Form->input('title', array(
								"div" => array(
									"title" => "title"
								),
								"label" => false,
								"class" => "span12"
							))
						?>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label"><?php echo __("desc");?></label>
					<div class="controls">
						<?php
							echo $this->Form->input('desc', array(
								"div" => array(
									"title" => "desc"
								),
								"label" => false,
								"class" => "span12"
							))
						?>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label"><?php echo __("status");?></label>
					<div class="controls">
						<?php echo $this->element("libs/status_edit")?>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label"><?php echo __("cateproducts_id");?></label>
					<div class="controls">
						<?php
							echo $this->Form->input('cateproducts_id', array(
								"div" => array(
									"class" => "span12"
								),
								"label" => false,
								"class" => "select2"
							))
						?>
					</div>
				</div>
			</div>
		</section>
	<?php echo $this->Form->end();?>
</div>